package com.service.business.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.service.business.order.controller.rep.*;
import com.service.business.order.controller.req.RenewOrderReq;
import com.service.core.rest.response.CommonPageRep;
import com.service.dao.dto.OrderMemberRank;
import com.service.dao.model.OrderProductHrCombo;
import com.service.business.order.controller.req.OrderComboPageReq;
import com.service.business.order.controller.req.OrderReq;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 算力订单
 *
 * @author xxxx
 * @email xxxx@qq.com
 * @date 2019-11-10 22:06:11
 */
public interface OrderProductHrComboService extends IService<OrderProductHrCombo> {

    BaseOrderRep orderHashRateCombo(OrderReq orderReq);

    String buildShopOrderNo();

    CommonPageRep<OrderHrComboPageRep> page(OrderComboPageReq pageReq);

    BaseOrderRep getOrderPayInfo(String orderNo);

    OrderHrComboDetailRep getOrderDetail(String orderNo);

    /**
     * @Description: 统计当前订单的收益明细
     * @Author: ty
     * @Date: 2021/4/29 11:35
     * @param: [orderId]
     * @return: com.service.business.order.controller.rep.OrderRewardDetailsRep
     **/
    OrderRewardDetailsRep getOrderRewardDetail(Integer orderId);

    OrderProductHrCombo getOrderDetailByOrderNo(String orderNo);

    OrderProductHrCombo getOrderDetailByOrderNo4Pay(String orderNo);

    void cancelOrder(String orderNo);

    void cancelOrder(Integer orderId);

    Integer totalEffectiveOrderByMemberIdAndComboId(Integer memberId, Integer comboId);

    BigDecimal totalEffectiveOrderByMemberId(Integer memberId, Integer coinsId, Integer orderStatus);

    BigDecimal totalEffectiveOrderAndStatusByMemberId(Integer memberId);

    /**
     * 大于0的有效订单统计
     * @param memberId
     * @return
     */
    BigDecimal totalEffectiveHrRateLargeThanZeroByMemberId(Integer memberId);

    BigDecimal totalEffectiveOrderByMemberList(List<Integer> memberIds);

    void renewOrder(String orderNo, RenewOrderReq req);

    MyHashRateTotalRep totalHashRate(String coinsName);

    TotalMyHashRateRep totalHashRateDetails(String coinsName);

    MyOrderHashRateRep totalMyOrderHashRateByCoin(String coinsName);

    /**
     * @Description: 统计用户们销量
     * @Author: ty
     * @Date: 2021/4/30 15:25
     * @param: [memberIds]
     * @return: java.math.BigDecimal
     **/
    BigDecimal totalEffectiveOrderPayByMemberList(List<Integer> memberIds, List<Integer> orderStatus);

    /**
     * 统计本月排行
     * @param coinsName
     * @param currentMonth
     * @return
     */
    OrderMemberRank totalRankByPayMoneyAndSomeMonth(String coinsName, Date currentMonth);

    /**
     * @Description: 统计当前用户币种的质押数量
     * @Author: ty
     * @Date: 2021/5/11 15:17
     * @param: [memberId, coinsName]
     * @return: java.math.BigDecimal
     **/
    BigDecimal totalPledgeNumByMemberIdAndCoins(Integer memberId, String coinsName);

    /**
     *  根据状态统计用户伞下算力
     * @param memberIds
     * @param orderStatus
     * @return
     */
    BigDecimal totalUmbrellaEffectiveHashRateByMemberIdsAndStatus(List<Integer> memberIds, List<Integer> orderStatus);
}

